]> dgit.raspbian.org Git - vtk9.git/commitdiff
Check for null pointer in vtkMatplotlibMathTextUtilities
authorDrew Parsons <dparsons@debian.org>
Tue, 13 Oct 2026 10:08:50 +0000 (12:08 +0200)
committerMaximiliano Curia <maxy@debian.org>
Tue, 13 Oct 2026 10:08:50 +0000 (12:08 +0200)
Forwarded: not-needed

Check if image scalar pointer is null before accessing to avoid crash on s390x.

Gbp-Pq: Name matplotlib_nullptr_s390x.patch

Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx

index 3e6b219f047e8969839609a08dd4b7796994eb21..714723e5d45040fba41ecbabb1c745060659d28c 100644 (file)
@@ -1023,6 +1023,12 @@ bool vtkMatplotlibMathTextUtilities::RenderOneCell(vtkImageData* image, int bbox
         return false;
       }
 
+      if (ptr == nullptr)
+      {
+       vtkErrorMacro("image returned null ScalarPointer.");
+       return false;
+      }
+
       // Background, do not load python data
       if (row > pythonRowStart || col < pythonColStart || row <= pythonRowEnd ||
         col >= pythonColEnd)